/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-08-19 08:43:57
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-08-20 11:29:10
 * @FilePath: \FCDS_032C\app\flapp_peripheral.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __FLAPP_PERIPHERAL_H__
#define __FLAPP_PERIPHERAL_H__
#include "flapp_system.h"

#define KEY_SHORT_TMR											1
#define KEY_LONG_TMR											30

#define	TIME_1_MIN											60
#define	COUNT_DOWN_DEFAULT							150  //150*0.2s
#define	VOL_DEFAULT							        4
#define	PLAY_ONCE								        1
#define	PLAY_WTICE							        2
#define	VOICE_MEDI_ALA					        0x00
#define	VOICE_KEY								        0x01
#define	VOICE_BEST_WISH					        0x02
#define	VOICE_NET_OK						        0x03
#define	VOICE_POW_OFF						        0x04
#define	VOICE_POW_ON						        0x05
#define	VOICE_KEY_VOL						        0x06
#define	VOICE_VOL_0							        0xe0
#define	VOICE_VOL_1							        0xe1
#define	VOICE_VOL_2							        0xe2
#define	VOICE_VOL_3							        0xe3
#define	VOICE_VOL_4							        0xe4
#define	VOICE_VOL_5							        0xe5
#define	VOICE_VOL_6							        0xe6
#define	VOICE_VOL_7							        0xe7
#define	VOICE_MUTE_HEAD					        0xf1
#define	VOICE_MUTE_TAIL					        0xf3

typedef enum
{
  KEY_PRESS                               = 0,
  KEY_RELEASE                             = 1,
} key_type;

typedef enum
{
  KEY_NUM_NULL                            = 0,
  KEY_NUM_ONE                             = 1,
	KEY_NUM_INVALID													= 2,
} key_num_type;

typedef enum
{
	KEY_NULL																= 0,
  KEY_POWER_SHORT                         = 1,
  KEY_POWER_LONG                          = 2,
	KEY_VISIT_SHORT                         = 3,
  KEY_VISIT_LONG                          = 4,
	KEY_VOL_ADD_SHORT                       = 5,
  KEY_VOL_ADD_LONG                        = 6,
	KEY_VOL_SUB_SHORT                       = 7,
  KEY_VOL_SUB_LONG                        = 8,
}key_val_type;

typedef enum
{
	VOL_LEV_0																= 0,
  VOL_LEV_1                         = 1,
  VOL_LEV_2                          = 2,
	VOL_LEV_3                         = 3,
  VOL_LEV_4                          = 4,
} device_vol_type;
//系统参数
typedef struct
{
	bool bPowOnOff;
	bool bHaveUsb;
	bool bTestMode;
	u8 u8VolLev;
	u8 u8BatEle;
  u8 u8PowOffCountDown;
}flapp_sys_para_t;

void flapp_set_med_alarm(u8 var);
void flapp_set_volume(u8 vol);
void fldrv_pro_voice_command(void);
void flapp_device_power_off(void);
void flapp_set_play_command(u8 cmd,u8 cnt);
void flapp_peripheral_init(void);
void flapp_peripheral_fun(void);
void flapp_peripheral_tmr_run(void);
void flapp_set_sys_para(flapp_sys_para_t para);
flapp_sys_para_t flapp_get_sys_para(void);
#endif
